<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div class="layui-form layuimini-form">
    <div class="layuimini-main">

        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">appid</label>
                <div class="layui-input-block">
                    <input type="text" name="appid" value="{$info.appid}"  autocomplete="off" placeholder="appid" class="layui-input iwidth" aria-disabled="true">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">版本号</label>
                <div class="layui-input-block">
                    <input type="text" name="version" value="{$info.version}"  autocomplete="off" placeholder="版本号" class="layui-input iwidth" aria-disabled="true">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">下载地址</label>
                <div class="layui-input-block">
                    <input type="text" name="url" value="{$info.url}"  autocomplete="off" placeholder="下载地址" class="layui-input iwidth" aria-disabled="true">
                </div>
            </div>
            <div class="layui-form-item" >
                <label class="layui-form-label">更新日志</label>
                <div class="layui-input-block">
                    <textarea type="text" name="note" value="{$info.note}" lay-verify="explain" autocomplete="off" placeholder="更新日志" class="layui-input iwidth" aria-disabled="true" style="margin: 0px 1156px 0px 0px;height: 152px;width: 403px;">{$info.note}</textarea>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="add">保存</button>
                </div>
            </div>
        </form>

    </div>
</div>

{include file="public/footer" /}

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate','wangEditor'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , wangEditor = layui.wangEditor
            , $ = layui.jquery;
        //监听提交修改
        form.on('submit(add)', function (data) {
            let  postdata =data.field
            $.ajax({
                url: '/admin/Apply/version_control?active=ajax',
                type: 'post',
                dataType: 'json',
                data: postdata,
                success: function (res) {
                    if (res.status == true) {    // 获得frame索引
                        parent.layer.msg("操作成功!",
                            {
                                icon:1,
                                time: 1000
                            },
                            function () {
                        });
                        return;
                    } else{
                        layer.msg(res.msg,{ icon:5,
                            time: 1000});
                    }
                },
                error: function () {
                    layer.msg("报错了");
                }
            });
            return false;
        });
    });




</script>
</body>
</html>